<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     template="../../../Template.xhtml"
>
<ui:define name="title">Edit private Carriers</ui:define>

<ui:define name="body">

<h:form>
	<p:panelGrid columns="2">
<h2>Edit private Carrier</h2>
<p:commandButton value="Back" action="ManagePrivateCarriers.xhtml" />
</p:panelGrid>
</h:form>
<br/><br/><br/><br/>
<h:form>
<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />

	<p:panelGrid columns="3">
	<p:outputLabel  value="Last Name :" />
		<p:inputText id="LName" value="#{clientMB.client.nom}" required="true"   requiredMessage="last name is required"/>
		<p:message for="LName"/>
		
		<p:outputLabel  value="First Name :" />
		<p:inputText id="fName" value="#{clientMB.client.prenom}" required="true"   requiredMessage="forst name is required"/>
		<p:message for="fName"/>
		
		<p:outputLabel value="Select Transport type :"/>
        <p:selectCheckboxMenu  id="tr" label="Transport type" value="#{clientMB.listeTransport}"   filter="true" filterMatchMode="startsWith" panelStyle="width:250px"  > 
        <p:ajax listener="#{clientMB.onChangeListTransport()}" update="TransportCat" />
         <f:selectItems value="#{clientMB.listTransport()}" var="a" itemValue="#{a.idTransport}" itemLabel="#{a.intitule}" />
        </p:selectCheckboxMenu>
        	<p:message for="tr"/>
      <p:outputLabel value="Select Transport Category :"/>
      <p:selectCheckboxMenu id="TransportCat" value="#{clientMB.listIdentifiantTransCat}" label="Transport category"
                              filter="true" filterMatchMode="startsWith" panelStyle="width:250px"  >
            <f:selectItems value="#{clientMB.listTransportCat}" var="a" itemValue="#{a.idTransportCat}" itemLabel="#{a.intitule}" />
      </p:selectCheckboxMenu>
          <p:message for="TransportCat"/>
		
		
	  <p:outputLabel value="Select Country :" />
	   <p:selectOneMenu id="country" value="#{clientMB.idC}" style="width:150px"  required="true" requiredMessage="please select a country" >
                <p:ajax listener="#{clientMB.onCountryChange(0)}" update="State" />
                <f:selectItem itemLabel="Select Country" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{clientMB.listPays}" var="a" itemValue="#{a.idPays}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
            <p:message for="country"/>
	
	  <p:outputLabel value="Select State :" />
	  <p:selectOneMenu id="State" value="#{clientMB.idS}" style="width:150px"  required="true" requiredMessage="please select a state">
               <p:ajax listener="#{clientMB.onStateChange(0)}" update="city" />
                 <f:selectItem itemLabel="Select State" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{clientMB.listeEtat}"  var="s" itemValue="#{s.idEtat}"  itemLabel="#{s.intitule}"/>
            </p:selectOneMenu>
            <p:message for="State"/>
            
            
		<p:outputLabel value="Select City :"/>
		  <p:selectOneMenu id="city" value="#{clientMB.idCi}" style="width:150px"  required="true" requiredMessage="City is required" >
                <f:selectItem itemLabel="Select city" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{clientMB.listeVille}" var="a" itemValue="#{a.idVille}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
               <p:message for="city"/>
               
               
            <p:outputLabel  value="Zipcode :" />
		<p:inputText id="zipcode" value="#{clientMB.client.codePost_usr}" required="true"   requiredMessage="zip code is required"/>
		<p:message for="zipcode"/>
		
		
		 <p:outputLabel  value="Street :" />
		<p:inputText id="Street" value="#{clientMB.client.rue_usr}" required="true"   requiredMessage="street is required"/>
		<p:message for="Street"/>
		
		
		
		<p:outputLabel  value="Telephone :" />
		<p:inputText id="Telephone" value="#{clientMB.client.telephone_usr}" required="true"   requiredMessage="Telephone is required"/>
		<p:message for="Telephone"/>
		
		
		<p:outputLabel  value="Mobile :" />
		<p:inputText id="Mobile" value="#{clientMB.client.mobile_usr}" required="true"   requiredMessage="Mobile is required"/>
		<p:message for="Mobile"/>
		
		
		<p:outputLabel value="Industry Type :"/>
		  <p:selectOneMenu id="Industry" value="#{clientMB.idIndustry}" style="width:150px" required="true"   requiredMessage="Industry Type is required"  >
                <f:selectItem itemLabel="Select Country" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{clientMB.listeIndustrie()}" var="a" itemValue="#{a.idIndustrie}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
            <p:message for="Industry"/>
		
		
		<p:outputLabel  value="Email :" />
		<p:inputText id="Email" value="#{clientMB.client.email}" required="true"   requiredMessage="Email is required"/>
		<p:message for="Email"/>
		
			<p:outputLabel  value="Password :" />
		<p:inputText id="Password" value="#{clientMB.client.password}" required="true"   requiredMessage="Password is required"/>
		<p:message for="Password"/>
		
		
		<p:outputLabel  value="Username :" />
		<p:inputText id="Username" value="#{clientMB.client.username}" required="true"   requiredMessage="Username is required"/>
		<p:message for="Username"/>
		
		<p:outputLabel  value="Client Identification Number(CID) :" />
		<p:inputText id="clid" value="#{clientMB.client.CID}" readonly="true"/>
		<p:message for="clid"/>
		
		
		
		<p:outputLabel value="Status :" />
		<p:selectOneMenu value="#{clientMB.client.statut}" >
			<f:selectItem  itemValue="true" itemLabel="Active"  />
			<f:selectItem  itemValue="false" itemLabel="Inactive"  />
		</p:selectOneMenu><br/>
		<p:commandButton action="#{clientMB.Modifier}" value="Update" ></p:commandButton>
	</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>